﻿using System.IO;

namespace ZerAx.ObjectNotation
{
    public class ZonString : Zon
    {
        public override ZonType Type => ZonType.String;
        public string data;

        public ZonString() { }

        public ZonString(string val)
        {
            data = val;
        }

        public override void Initialize(BinaryReader reader)
        {
            data = reader.ReadString();
        }

        public override void SerializeData(BinaryWriter writer)
        {
            writer.Write(data);
        }

        public override string ToString()
        {
            return $"\"{data}\"";
        }
    }
}
